import React from 'react';
import CommonList from '../../../components/CommonLists/list';
import { Tooltip, Button } from 'antd';

class RiskTypeList extends CommonList {
  constructor(props) {
    super(props);
    this.api = 'riskType';
  }

  getColumn = () => {
    return [
      {
        title: '风险类型',
        key: 'name',
        dataIndex: 'name',
        ellipsis: true,
        render: (text, record) => {
          return (
            <Tooltip title={text} placement='topLeft'>
              {text}
            </Tooltip>
          );
        },
      },
      {
        title: '风险类型code',
        key: 'code',
        dataIndex: 'code',
        render: (text, record) => {
          return (
            <Tooltip title={text} placement='topLeft'>
              {text}
            </Tooltip>
          );
        },
      },
      {
        title: '描述',
        dataIndex: 'remark',
        key: 'remark',
        ellipsis: true,
        width: '20%',
        render: (text) => {
          return (
            <Tooltip title={text} placement='topLeft'>
              {text}
            </Tooltip>
          );
        },
      },
      {
        title: '创建/修改人',
        dataIndex: 'createBy',
        key: 'createBy',
        ellipsis: true,
        render: (text, record) => {
          var content = !!record.updateBy
            ? `${record.createBy}/${record.updateBy}`
            : `${record.createBy}/${record.createBy}`;
          return (
            <Tooltip title={content} placement='topLeft'>
              {content}
            </Tooltip>
          );
        },
      },
      {
        title: '修改时间',
        dataIndex: 'updateAt',
        key: 'updateAt',
        ellipsis: true,
        render: (text) => {
          return (
            <Tooltip title={text} placement='topLeft'>
              {text}
            </Tooltip>
          );
        },
      },
    ];
  };
}

export default RiskTypeList;
